﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using h = functionService.shorts;
using da = functionService.DATECOD;
using fr = HK.FiscalRegistrar.FiscalRegistrar;
using vv = functionService.serfun_city7;
using tg = functionService.tagWork;

namespace city7
{
    public partial class FormCodKol : Form
    {
        string cod, kol;
        public FormCodKol()
        {
            InitializeComponent();    cod = "0"; kol = "0";
            if (vv.codKol.enterEnter)  { checkBox1.Checked = true; } 
            else { checkBox1.Checked = false; }

            //h.m(h.aa(this.Controls[0].Name,
            //    this.Controls[1].Name,
            //    this.Controls[2].Name,
            //    this.Controls[3].Name,
            //    this.Controls[4].Name));
        }

        private void textBox1_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                cod = textBox1.Text;     this.Controls[3].Select();
            }
        }

        private void textBox2_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                kol = textBox2.Text.Replace(",", ".");  this.Close();
            }
        }

        public string  COD
        {
            get 
            {
                return cod;
            }
        }
        public string KOL
        {
            get
            {
                return  kol;
            }
        }

        private void textBox2_Enter(object sender, EventArgs e)
        {
            if (textBox1.Text.Length == 0) { this.Controls[4].Select(); }
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            vv.codKol.enterEnter = checkBox1.Checked;
        }
    }
}
